﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>个人专栏</title>
    <link type="text/css" rel="stylesheet" href="__TMPL__style/group-style.css" />
    <script type="text/javascript" src="__ROOT__/Public/Js/jquery-1.5.0.min.js"></script>
    <script type="text/javascript" src="__ROOT__/Public/Js/core.js"></script>
  </head>
  <body>
    <layout name="Public:circle-header2" cache="0" />
    <layout name="Public:group-member-base" cache="0" />
    <div class="content" style="height:auto;overflow:hidden">
      <layout name='left' cache='0' />
      <div class="column_right" id="right">
        <ul>
          <li ><a href="__URL__/index/uid/{$uid}">最新动态</a></li>
          <li class="<?=$tab==2?'cuerrt':''?>"><a  href="__URL__/diarys/uid/{$uid}">个人博文</a></li>
          <li class="<?=$tab==3?'cuerrt':''?>"><a  href="__URL__/articleList/uid/{$uid}" >群组文章</a></li>
          <li><a  href="__URL__/weibo/uid/{$uid}" >微博</a></li>
          <!--<li><a href="#">个人相册</a></li>
          <li><a href="#">留 言 板</a></li>-->
          <div class="clear"></div>
        </ul>
        <div class="column_content">
          <if condition="$dev eq 1">
            <if condition="$tab eq 2"><a href="#">发表博文</a>
              <else/><a href="#">发表文章</a>
            </if>
          </if>
          <if condition="$list neq NULL and $tab==3">
            <volist name="list" id="item">
              <dl>
                <dt><h3><a href="__APP__/circle/article/cyid/{$item['cyid']}/id/{$item['id']}">{$item['title']}</a></h3>
                  <div class="publish_time">发表于:{$item['create_time']} <span>[来自群组：{$item['cname']}]</span></div></dt>
                <dd>
                  <div class="txt_info">
                   	  	{$item['content']}
                  </div>
                  <div class="jian" id="a_{$item['id']}" onclick="setPromote('a',{$item['id']})" style="cursor:pointer">{$item['recommend_num']}<span>已推荐</span></div>
                  <div class="clear"></div>
                </dd>
                <div class="count_read">阅读({$item['read_num']}) | 评论({$item['comment_num']})</div>
              </dl>
            </volist>
          </if>

          <if condition="$list neq NULL and $tab==2">
            <volist name="list" id="item">
              <dt><h3><a href="/pw8/apps.php?q=diary&a=detail&isFrame=1&did={$item['did']}">{$item['subject']}</a></h3>
                <div class="publish_time">发表于：<?=date('Y-m-d',$item['postdate'])?><span>[<a href="#">来自博文</a>]</span></div></dt>
              <dd>
                <div class="txt_info">
                   	  	{$item['content']}
                </div>
                <div class="jian" id="d_{$item['did']}" onclick="setPromote('d',{$item['did']})" style="cursor:pointer">{$item['recommend_num']}<span>已推荐</span></div>
                <div class="clear"></div>
              </dd>
              <div class="count_read">阅读({$item['r_num']}) | 评论({$item['c_num']})</div>
            </volist>
          </if>
          <div>{$page}</div>
        </div>
      </div>
      <div class="clear"></div>
      <script>
        var Lh = document.getElementById("left");
        var Mh = document.getElementById("right");
        if (Lh.offsetHeight>Mh.offsetHeight){
          Mh.style.height = Lh.offsetHeight+"px";
        }
        else{
          Lh.style.height = Mh.offsetHeight+"px";
        }
      </script>
    </div>
    <div class="footer" style="clear:both">
      <layout name="Public:footer" cache="0" /></div>
    </div>
    <script>
      var doneList=new Array();
      function setPromote(type,id){
        var doneFlag=false;
        for(var i=0; i<doneList.length ;++i){
          if(doneList[i]==type+'_'+id){
            doneFlag=true;
            break;
          }
        }
        if(!doneFlag){
          //document.write('__URL__/setPromoteAjax/type/'+type+'/uid/'+{$uid}+'/id/'+id);
          $.getJSON('__URL__/setPromoteAjax/type/'+type+'/isAjax/1/id/'+id,
          function(data){
            var num=parseInt(data.result);
            if(num>0){
              $('#'+type+'_'+id).html(num+"<span>已推荐</span>");
              doneList.push(type+'_'+id);
              alert('推荐成功');
            }
          }
        );
        }else{alert('您已经推荐过该文章了');}
      }
    </script>
  </body>
</html>